Optimal. Leaf size=236 \[ \frac {a \left (8 c^4+16 c^3 d+24 c^2 d^2+12 c d^3+3 d^4\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a \left (12 c^4+95 c^3 d+112 c^2 d^2+80 c d^3+16 d^4\right ) \tan (e+f x)}{30 f}+\frac {a d \left (24 c^3+130 c^2 d+116 c d^2+45 d^3\right ) \sec (e+f x) \tan (e+f x)}{120 f}+\frac {a \left (12 c^2+35 c d+16 d^2\right ) (c+d \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac {a (4 c+5 d) (c+d \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.30, antiderivative size = 236, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {4087, 4082,
3872, 3855, 3852, 8} \begin {gather*} \frac {a \left (12 c^2+35 c d+16 d^2\right ) \tan (e+f x) (c+d \sec (e+f x))^2}{60 f}+\frac {a d \left (24 c^3+130 c^2 d+116 c d^2+45 d^3\right ) \tan (e+f x) \sec (e+f x)}{120 f}+\frac {a \left (12 c^4+95 c^3 d+112 c^2 d^2+80 c d^3+16 d^4\right ) \tan (e+f x)}{30 f}+\frac {a \left (8 c^4+16 c^3 d+24 c^2 d^2+12 c d^3+3 d^4\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a \tan (e+f x) (c+d \sec (e+f x))^4}{5 f}+\frac {a (4 c+5 d) \tan (e+f x) (c+d \sec (e+f x))^3}{20 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3872
Rule 4082
Rule 4087
Rubi steps
\begin {align*} \int \sec (e+f x) (a+a \sec (e+f x)) (c+d \sec (e+f x))^4 \, dx &=\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f}+\frac {1}{5} \int \sec (e+f x) (c+d \sec (e+f x))^3 (a (5 c+4 d)+a (4 c+5 d) \sec (e+f x)) \, dx\\ &=\frac {a (4 c+5 d) (c+d \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f}+\frac {1}{20} \int \sec (e+f x) (c+d \sec (e+f x))^2 \left (a \left (20 c^2+28 c d+15 d^2\right )+a \left (12 c^2+35 c d+16 d^2\right ) \sec (e+f x)\right ) \, dx\\ &=\frac {a \left (12 c^2+35 c d+16 d^2\right ) (c+d \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac {a (4 c+5 d) (c+d \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f}+\frac {1}{60} \int \sec (e+f x) (c+d \sec (e+f x)) \left (a \left (60 c^3+108 c^2 d+115 c d^2+32 d^3\right )+a \left (24 c^3+130 c^2 d+116 c d^2+45 d^3\right ) \sec (e+f x)\right ) \, dx\\ &=\frac {a d \left (24 c^3+130 c^2 d+116 c d^2+45 d^3\right ) \sec (e+f x) \tan (e+f x)}{120 f}+\frac {a \left (12 c^2+35 c d+16 d^2\right ) (c+d \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac {a (4 c+5 d) (c+d \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f}+\frac {1}{120} \int \sec (e+f x) \left (15 a \left (8 c^4+16 c^3 d+24 c^2 d^2+12 c d^3+3 d^4\right )+4 a \left (12 c^4+95 c^3 d+112 c^2 d^2+80 c d^3+16 d^4\right ) \sec (e+f x)\right ) \, dx\\ &=\frac {a d \left (24 c^3+130 c^2 d+116 c d^2+45 d^3\right ) \sec (e+f x) \tan (e+f x)}{120 f}+\frac {a \left (12 c^2+35 c d+16 d^2\right ) (c+d \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac {a (4 c+5 d) (c+d \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f}+\frac {1}{8} \left (a \left (8 c^4+16 c^3 d+24 c^2 d^2+12 c d^3+3 d^4\right )\right ) \int \sec (e+f x) \, dx+\frac {1}{30} \left (a \left (12 c^4+95 c^3 d+112 c^2 d^2+80 c d^3+16 d^4\right )\right ) \int \sec ^2(e+f x) \, dx\\ &=\frac {a \left (8 c^4+16 c^3 d+24 c^2 d^2+12 c d^3+3 d^4\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a d \left (24 c^3+130 c^2 d+116 c d^2+45 d^3\right ) \sec (e+f x) \tan (e+f x)}{120 f}+\frac {a \left (12 c^2+35 c d+16 d^2\right ) (c+d \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac {a (4 c+5 d) (c+d \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f}-\frac {\left (a \left (12 c^4+95 c^3 d+112 c^2 d^2+80 c d^3+16 d^4\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{30 f}\\ &=\frac {a \left (8 c^4+16 c^3 d+24 c^2 d^2+12 c d^3+3 d^4\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a \left (12 c^4+95 c^3 d+112 c^2 d^2+80 c d^3+16 d^4\right ) \tan (e+f x)}{30 f}+\frac {a d \left (24 c^3+130 c^2 d+116 c d^2+45 d^3\right ) \sec (e+f x) \tan (e+f x)}{120 f}+\frac {a \left (12 c^2+35 c d+16 d^2\right ) (c+d \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac {a (4 c+5 d) (c+d \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac {a (c+d \sec (e+f x))^4 \tan (e+f x)}{5 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.82, size = 153, normalized size = 0.65 \begin {gather*} \frac {a \left (15 \left (8 c^4+16 c^3 d+24 c^2 d^2+12 c d^3+3 d^4\right ) \tanh ^{-1}(\sin (e+f x))+\tan (e+f x) \left (120 (c+d)^4+15 d \left (16 c^3+24 c^2 d+12 c d^2+3 d^3\right ) \sec (e+f x)+30 d^3 (4 c+d) \sec ^3(e+f x)+80 d^2 \left (3 c^2+2 c d+d^2\right ) \tan ^2(e+f x)+24 d^4 \tan ^4(e+f x)\right )\right )}{120 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.40, size = 313, normalized size = 1.33 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 410, normalized size = 1.74 \begin {gather*} \frac {480 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a c^{2} d^{2} + 320 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a c d^{3} + 16 \, {\left (3 \, \tan \left (f x + e\right )^{5} + 10 \, \tan \left (f x + e\right )^{3} + 15 \, \tan \left (f x + e\right )\right )} a d^{4} - 60 \, a c d^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 15 \, a d^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 240 \, a c^{3} d {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 360 \, a c^{2} d^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 240 \, a c^{4} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 240 \, a c^{4} \tan \left (f x + e\right ) + 960 \, a c^{3} d \tan \left (f x + e\right )}{240 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.35, size = 291, normalized size = 1.23 \begin {gather*} \frac {15 \, {\left (8 \, a c^{4} + 16 \, a c^{3} d + 24 \, a c^{2} d^{2} + 12 \, a c d^{3} + 3 \, a d^{4}\right )} \cos \left (f x + e\right )^{5} \log \left (\sin \left (f x + e\right ) + 1\right ) - 15 \, {\left (8 \, a c^{4} + 16 \, a c^{3} d + 24 \, a c^{2} d^{2} + 12 \, a c d^{3} + 3 \, a d^{4}\right )} \cos \left (f x + e\right )^{5} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (24 \, a d^{4} + 8 \, {\left (15 \, a c^{4} + 60 \, a c^{3} d + 60 \, a c^{2} d^{2} + 40 \, a c d^{3} + 8 \, a d^{4}\right )} \cos \left (f x + e\right )^{4} + 15 \, {\left (16 \, a c^{3} d + 24 \, a c^{2} d^{2} + 12 \, a c d^{3} + 3 \, a d^{4}\right )} \cos \left (f x + e\right )^{3} + 16 \, {\left (15 \, a c^{2} d^{2} + 10 \, a c d^{3} + 2 \, a d^{4}\right )} \cos \left (f x + e\right )^{2} + 30 \, {\left (4 \, a c d^{3} + a d^{4}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{240 \, f \cos \left (f x + e\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int c^{4} \sec {\left (e + f x \right )}\, dx + \int c^{4} \sec ^{2}{\left (e + f x \right )}\, dx + \int d^{4} \sec ^{5}{\left (e + f x \right )}\, dx + \int d^{4} \sec ^{6}{\left (e + f x \right )}\, dx + \int 4 c d^{3} \sec ^{4}{\left (e + f x \right )}\, dx + \int 4 c d^{3} \sec ^{5}{\left (e + f x \right )}\, dx + \int 6 c^{2} d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int 6 c^{2} d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int 4 c^{3} d \sec ^{2}{\left (e + f x \right )}\, dx + \int 4 c^{3} d \sec ^{3}{\left (e + f x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 566 vs.
\(2 (224) = 448\).
time = 0.52, size = 566, normalized size = 2.40 \begin {gather*} \frac {15 \, {\left (8 \, a c^{4} + 16 \, a c^{3} d + 24 \, a c^{2} d^{2} + 12 \, a c d^{3} + 3 \, a d^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right ) - 15 \, {\left (8 \, a c^{4} + 16 \, a c^{3} d + 24 \, a c^{2} d^{2} + 12 \, a c d^{3} + 3 \, a d^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (120 \, a c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 240 \, a c^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 360 \, a c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 180 \, a c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 45 \, a d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} - 480 \, a c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 1440 \, a c^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 1200 \, a c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 1160 \, a c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 130 \, a d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 720 \, a c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 2880 \, a c^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 2400 \, a c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 1600 \, a c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 464 \, a d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 480 \, a c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2400 \, a c^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2640 \, a c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 1400 \, a c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 190 \, a d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 120 \, a c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 720 \, a c^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1080 \, a c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 780 \, a c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 195 \, a d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{5}}}{120 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.51, size = 361, normalized size = 1.53 \begin {gather*} \frac {a\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (8\,c^4+16\,c^3\,d+24\,c^2\,d^2+12\,c\,d^3+3\,d^4\right )}{2\,\left (4\,c^4+8\,c^3\,d+12\,c^2\,d^2+6\,c\,d^3+\frac {3\,d^4}{2}\right )}\right )\,\left (8\,c^4+16\,c^3\,d+24\,c^2\,d^2+12\,c\,d^3+3\,d^4\right )}{4\,f}-\frac {\left (2\,a\,c^4+4\,a\,c^3\,d+6\,a\,c^2\,d^2+3\,a\,c\,d^3+\frac {3\,a\,d^4}{4}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^9+\left (-8\,a\,c^4-24\,a\,c^3\,d-20\,a\,c^2\,d^2-\frac {58\,a\,c\,d^3}{3}-\frac {13\,a\,d^4}{6}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7+\left (12\,a\,c^4+48\,a\,c^3\,d+40\,a\,c^2\,d^2+\frac {80\,a\,c\,d^3}{3}+\frac {116\,a\,d^4}{15}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (-8\,a\,c^4-40\,a\,c^3\,d-44\,a\,c^2\,d^2-\frac {70\,a\,c\,d^3}{3}-\frac {19\,a\,d^4}{6}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (2\,a\,c^4+12\,a\,c^3\,d+18\,a\,c^2\,d^2+13\,a\,c\,d^3+\frac {13\,a\,d^4}{4}\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________